// 代理目标: 谁别别人代理谁就是代理目标
const t = {
  name: "阿芳",
  gender: '靓妹'
};

const handler = {
  get(target, property, receiver) {
    return target[property];
  },
  set(target, property, value, receiver) {
    console.log(target, property, value, receiver);
    target[property] = value;
  },
};

// 代理对象: 谁去代理别人谁就是代理对象
const p = new Proxy(t, handler);

console.log(p.name, p.gender);

p.name = "阿然";
p.gender = '靓仔';

console.log(p.name, p.gender);
